import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;

import java.io.*;

public class Test1 {
    public static void main2(String[] args) throws FileNotFoundException {
        File file = new File("123.txt");
        byte[] bytes = new byte[5];
        try{
            FileInputStream in = new FileInputStream(file);
            int m = in.read(bytes,0,5);
            System.out.println(m);
            System.out.println(new String(bytes,0,5));
            m = in.read(bytes,0,5);
            System.out.println(m);
            System.out.println(new String(bytes,0,5));

        }catch (IOException e){

        }



    }

    public static void main3(String[] args) {
        File file = new File("123.txt");
        try{
             FileOutputStream fileOutputStream = new FileOutputStream(file);
            ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
            objectOutputStream.write(new Integer(1));
            FileInputStream fileInputStream = new FileInputStream(file);
            ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);



        }catch (IOException e){

        }


    }

    public static void main(String[] args) {
        File file = new File("123.txt");
        try{
            FileInputStream in = new FileInputStream(file);
            int c = in.read();
            System.out.println( c);
            c = in.read();
            System.out.println((char) c);

        }catch (IOException e){

        }
    }
}
